package test.Sorting;

import java.util.Scanner;

public class PalindromicString {
    public static boolean isPalindrome(String s) {
        StringBuffer sgood = new StringBuffer();
        for (int i = 0;i<s.length();i++){
            char word = s.charAt(i);
            if (Character.isLetterOrDigit(word)){
                sgood.append(Character.toLowerCase(word));
            }
        }
        Scanner scanner = new Scanner(System.in);
        int i = scanner.nextInt();
        StringBuffer reverse = new StringBuffer(sgood).reverse();
        return sgood.toString().equals(reverse.toString());

    }

    public static void main(String[] args) {
        String s = "A man, a plan, a canal: Panama";
        System.out.println(isPalindrome(s));
    }
}
